/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.atomojo.sparql;

/**
 *
 * @author alex
 */
public class Triple {

   Ref subject;
   Ref predicate;
   Ref object;
   boolean optional;
   public Triple(Ref subject,Ref predicate,Ref object) {
      this.subject = subject;
      this.predicate = predicate;
      this.object = object;
      this.optional = false;
   }
   
   public boolean isOptional() {
      return optional;
   }
   
   public void setOptional(boolean flag) {
      this.optional = flag;
   }
   
   public Ref getSubject() {
      return subject;
   }
   public Ref getPredicate() {
      return predicate;
   }
   public Ref getObject() {
      return object;
   }
   
   public String toString() {
      StringBuilder builder = new StringBuilder();
      builder.append(subject.toString());
      builder.append(" ");
      builder.append(predicate.toString());
      builder.append(" ");
      builder.append(object.toString());
      return builder.toString();
   }
}
